package cn.xiaonhui;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/*
 * HashMap的用法
 * 遍历集合的元素，通过所以映射遍历
 */
public class ExampleTest39 {

	public static void main(String[] args) {
		// TODO 自动生成的方法存根
      //Map<String,String>new HashMap<String,string>();
      //map.put("1","小小");
      //ArrayList<String>arrayList=new ArrayList<String>();
      //arrayList.add("dasad");
      //arrayList.add("dasad");
      //arrayList.add("dasad");
      //for(Object Strring:arrayList) {
    	  
     // }
   Map map=new HashMap();
   map.put("name", "小小");
   map.put("sex", "女");
   map.put("name", "1");
    Set entrySet=map.entrySet();
    Iterator iterator=entrySet.iterator();
    while(iterator.hasNext()) {
    	Map.Entry entry=(Map.Entry)(iterator.next());
    	Object key=entry.getKey();
    	Object value=entry.getValue();
    	System.out.println(key+":"+value);
    }
	}

}
